b1c180522c5e40776e388a58329c204db23cb45a,src/frontend/org/voltdb/utils/CSVLoaderMT.java,CSVLoaderMT,main,#String[]#,198
Before Change
if (remarks != null && remarks.equalsIgnoreCase("PARTITION_COLUMN")) {
partitionedColumnIndex = (int) procInfo.getLong("ORDINAL_POSITION");
partitionColumnType = vtype;
System.out.println("Partition Column Name is: " + procInfo.getString("COLUMN_NAME"));
System.out.println("Partition Column Type is: " + vtype.toString());
}
}
}
VoltTable.ColumnInfo colInfo[] = new VoltTable.ColumnInfo[columnTypes.size()];
for (int i = 0; i < columnTypes.size(); i++) {
VoltType type = columnTypes.get(i);
String cname = colNames.get(i);
VoltTable.ColumnInfo ci = new VoltTable.ColumnInfo(cname, type);
colInfo[i] = ci;
}
int numPartitions = -1;
int sitesPerHost = 1;
int kfactor = 0;
int hostcount = 1;
procInfo = csvClient.callProcedure("@SystemInformation",
"deployment").getResults()[0];
while (procInfo.advanceRow()) {
String prop = procInfo.getString("PROPERTY");
if (prop != null && prop.equalsIgnoreCase("sitesperhost")) {
sitesPerHost = Integer.parseInt(procInfo.getString("VALUE"));
}
if (prop != null && prop.equalsIgnoreCase("hostcount")) {
hostcount = Integer.parseInt(procInfo.getString("VALUE"));
}
if (prop != null && prop.equalsIgnoreCase("kfactor")) {
kfactor = Integer.parseInt(procInfo.getString("VALUE"));
}
}
numPartitions = (hostcount * sitesPerHost) / (kfactor + 1);
System.out.println("Number of Partitions: " + numPartitions);
System.out.println("Batch Size is: " + config.batch);
TheHashinator.initialize(LegacyHashinator.class, LegacyHashinator.getConfigureBytes(numPartitions));
After Change
boolean isMP = (partitionedColumnIndex == -1 ? true : false);
if (!isMP) {
numPartitions = (hostcount * sitesPerHost) / (kfactor + 1);
m_log.info("Number of Partitions: " + numPartitions);
m_log.info("Batch Size is: " + config.batch);
TheHashinator.initialize(LegacyHashinator.class, LegacyHashinator.getConfigureBytes(numPartitions));